package com.ruoyi.exa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exa.mapper.ExaClassQuestionsMapper;
import com.ruoyi.exa.domain.ExaClassQuestions;
import com.ruoyi.exa.service.IExaClassQuestionsService;

/**
 * 题目试题Service业务层处理
 * 
 * @author linziheng
 * @date 2025-07-15
 */
@Service
public class ExaClassQuestionsServiceImpl implements IExaClassQuestionsService 
{
    @Autowired
    private ExaClassQuestionsMapper exaClassQuestionsMapper;

    /**
     * 查询题目试题
     * 
     * @param id 题目试题主键
     * @return 题目试题
     */
    @Override
    public ExaClassQuestions selectExaClassQuestionsById(Long id)
    {
        return exaClassQuestionsMapper.selectExaClassQuestionsById(id);
    }

    /**
     * 查询题目试题列表
     * 
     * @param exaClassQuestions 题目试题
     * @return 题目试题
     */
    @Override
    public List<ExaClassQuestions> selectExaClassQuestionsList(ExaClassQuestions exaClassQuestions)
    {
        return exaClassQuestionsMapper.selectExaClassQuestionsList(exaClassQuestions);
    }

    /**
     * 新增题目试题
     * 
     * @param exaClassQuestions 题目试题
     * @return 结果
     */
    @Override
    public int insertExaClassQuestions(ExaClassQuestions exaClassQuestions)
    {
        exaClassQuestions.setCreateTime(DateUtils.getNowDate());
        return exaClassQuestionsMapper.insertExaClassQuestions(exaClassQuestions);
    }

    /**
     * 修改题目试题
     * 
     * @param exaClassQuestions 题目试题
     * @return 结果
     */
    @Override
    public int updateExaClassQuestions(ExaClassQuestions exaClassQuestions)
    {
        exaClassQuestions.setUpdateTime(DateUtils.getNowDate());
        return exaClassQuestionsMapper.updateExaClassQuestions(exaClassQuestions);
    }

    /**
     * 批量删除题目试题
     * 
     * @param ids 需要删除的题目试题主键
     * @return 结果
     */
    @Override
    public int deleteExaClassQuestionsByIds(Long[] ids)
    {
        return exaClassQuestionsMapper.deleteExaClassQuestionsByIds(ids);
    }

    /**
     * 删除题目试题信息
     * 
     * @param id 题目试题主键
     * @return 结果
     */
    @Override
    public int deleteExaClassQuestionsById(Long id)
    {
        return exaClassQuestionsMapper.deleteExaClassQuestionsById(id);
    }
    @Override
    public void deleteExaClassQuestionsByClassId(Long id)
    {
        exaClassQuestionsMapper.deleteExaClassQuestionsByClassId(id);
    }

}
